package me.numark.activities;

import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.umeng.update.UmengUpdateAgent;

import butterknife.Bind;
import me.numark.R;
import me.numark.model.User;
import me.numark.utils.Global;

/**
 * Created by kHRYSTAL on 15/8/2.
 */
public class AboutUsActivity extends BaseActivity implements View.OnClickListener {
    @Bind(R.id.talk_about)
    FrameLayout talkAbout;

    @Bind(R.id.current_version)
    FrameLayout currentVersion;

    @Bind(R.id.version)
    TextView txtVersion;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        activity_layout_res = R.layout.activity_about_us;
        super.onCreate(savedInstanceState);
        uiInit();
    }

    protected void uiInit() {
        titleTextView.setText(R.string.setting_about);
        txtVersion.setText(Global.appVersionName);
        talkAbout.setOnClickListener(this);
        currentVersion.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.talk_about: {
                User user = new User();
                user.uid = 1;
                user.nick = getString(R.string.user_system);
                ChatActivity.startChat(this, user);
            }
            break;
            case R.id.current_version:
                UmengUpdateAgent.forceUpdate(this);
                break;
            default:
                break;
        }
    }
}
